The present invention relates to an address converting method for use in a data processor with a virtual memory.
Along with the dramatic expansion of the applicable range of digital computers in recent years, a large memory space has come to be required. For this reason, there are extensively used virtual memory systems which permit expansion of the memory space without concern for the real size of the main memory. In such a system, the virtual address space is usually defined on a segment-by-segment or page-by-page basis for the physical address space of a real memory apparatus, which is realized with a main memory, and addresses in this virtual address system are designated by the use of logical addresses.
The physical address space in the above-mentioned real memory apparatus is used in small partitions, each corresponding to a page of logical addresses. Each page of a virtual address space required in the execution of processing is taken out of an external memory apparatus, such as a magnetic disk unit, and stored in one of the small partitions of the physical address space for subsequent use. Control of this procedure is accomplished with a control program known as a virtual memory manager to effectively utilize the limited physical space.
Conversion of logical addresses into physical addresses is accomplished by the address converting section of the data processing apparatus through a control structure consisting of a "table" of segment descriptors, page descriptors and the like which are present in the main memory. A conversion buffer, such as a translation lookaside buffer (TLB), is used for high-speed accomplishment of this address conversion
In a data processing apparatus using a similar virtual memory system, a computer program (hereunder referred to simply as "program") written in a machine language expresses all addresses in logical terms alone. However, in a privileged program as an operating system (OS), expression in physical addresses is frequently needed because the above-mentioned control structure consisting of a "table" of segment descriptors, page descriptors and the like have to be referred to and updated.
Methods used for accessing by physical addresses include the following.
A plurality of consecutive segments, equivalent to the capacity of the physical address space, are secured in the logical address space for use in accessing by the physical addresses. Further, pages in each segment are made to consecutively correspond with consecutive regions of the physical addresses. As a result, the physical address space is made to correspond with the logical addresses of specific segments, and accessing of consecutive memory spaces (physical addresses) by the use of consecutive logical addresses is thereby made possible.
For example, a first segment and a second segment are allocated to the physical address space for accessing by a physical address, and either the first or the second segment is selected by the former or latter half of this physical address. As a result, a segment address and an intra-segment relative address are synthesized into a logical address, by which the physical address space can be accessed, and at this time continuity is maintained in each segment. If these two specific segments can be secured in consecutive regions of the logical address space, further continuity and identity between the logical and physical addresses can be attained.
However, along with the significant rise of the degree of integration of semiconductor memories in recent years, the capacity of the physical address space keeps increasing. A consequence of this is the difficulty to secure the physical address space capacity over the logical address space for the purpose of accessing by physical addresses.
Meanwhile, International Business Machines, Inc. has proposed a system using an operating mode for accessing a memory by the use of logical addresses as physical addresses. However, where accessing by logical addresses and accessing by physical addresses may co-emerge in a single program, switching of the operating mode is required every time, resulting in the disadvantage of overhead loss.